INCLUDE_DIRECTORIES(../include ../lib/ctf/)

FILE(GLOB_RECURSE BMTEST_HEADERS ${PROJECT_SOURCE_DIR}/test "[a-zA-Z_]*.h")

SET(CTF_PATH /home/raymond/storage/proj/bellman/lib/ctf/script/)
SET(SCAN_SCRIPT scan.py)
SET(BMTEST_SRC "testmain.c")

ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/test/testmain.c
  DEPENDS ${BMTEST_HEADERS}
  COMMAND ${CTF_PATH}${SCAN_SCRIPT} ${BMTEST_HEADERS} -o test/testmain.c
  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
  COMMENT Generate test source file)

ADD_EXECUTABLE(bmtest testmain.c)

MESSAGE(STATUS headers:${BMTEST_HEADERS})
MESSAGE(STATUS script:${CTF_PATH})
TARGET_LINK_LIBRARIES(bmtest bm ctf)
